package business.dados;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

import business.sistema.Properties;

public class BancoDadosRelatorios 
{
	public static Connection getConnection() throws Exception
	{
		String driver = "org.postgresql.Driver";
		String url = Properties.URL();
		String user = "postgres";
		String password = "pos73dda";
		
		Class.forName(driver);
		Connection con = DriverManager.getConnection(url, user, password);
		return con;
	}
	
	public ResultSet getDados(String sql) throws Exception
	{
		Connection con = getConnection();
		Statement stm = con.createStatement();
		ResultSet rs = stm.executeQuery(sql);
		
		return rs;
	}
}
